package math.calcul;

import Jama.Matrix;

public class VDM {

    private double[] YnTab;
    private final double[][] VDMI = {
        {120.0, 0.0, 0.0, 0.0, 0.0, 0.0},
        {-274.0, 600.0, -600.0, 400.0, -150.0, 24.0},
        {225.0, -770.0, 1070.0, -780.0, 305.0, -500.0},
        {-85.0, 355.0, -590.0, 490.0, -205.0, 35.0},
        {15.0, -70.0, 130.0, -120.0, 55.0, -10.0},
        {-1.0, 5.0, -10.0, 10.0, -5.0, 1.0},};

    public VDM(double[] YnTab) {
        this.YnTab = YnTab;
    }

    public double[] calculate() {
        // VDMI * Yn = Coeff
        Matrix MVDMI = new Matrix(VDMI);
        MVDMI = MVDMI.times(1 / 120.0);
        Matrix MYn = new Matrix(YnTab, 6);
        
        return MVDMI.times(MYn).getColumnPackedCopy();
    }
}









